package com.mingyi;

import java.util.LinkedList;
import java.util.List;
import java.util.Random;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONException;


import android.app.Activity;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;

public class SlientVibratePlugin extends CordovaPlugin {

	@Override
	public boolean execute(String action, JSONArray args,
			CallbackContext callbackContext) throws JSONException {
		Log.i("xxxx","zhixing");
		String isSlient = args.getString(0);

		String isVibrate = args.getString(1);
		Log.i("xxxx","zhixing"+isSlient+">>>"+isVibrate);

		if ("set".equals(action)) {
			Log.i("xxxxxx",isSlient+">>>>"+isVibrate);
			MainActivity.instance.setRingerMode(Boolean.parseBoolean(isSlient),Boolean.parseBoolean(isVibrate));
			callbackContext.success();
			return true;

		} else {
			return false;
		}
	}


}
